package com.gitee.zycra.future.job.common.model;

import com.gitee.zycra.jdbc.annotation.Column;
import com.gitee.zycra.jdbc.annotation.ID;
import com.gitee.zycra.jdbc.annotation.Table;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * @author zycra
 */
@Getter
@Setter
@ToString
@Accessors(chain = true)
@Table("job_schedule")
public class JobSchedule {

    /**
     * 主键
     */
    @ID
    @Column("id")
    private Long id;

    /**
     * 元数据ID
     */
    @Column("job_meta_data_id")
    private Long jobMetaDataId;

    /**
     * 调度名称
     */
    @Column("schedule_name")
    private String scheduleName;

    /**
     * 执行参数
     */
    @Column("schedule_param")
    private String scheduleParam;

    /**
     * 月
     */
    @Column("cron_month")
    private Integer cronMonth;
    /**
     * 日
     */
    @Column("cron_day")
    private Integer cronDay;

    /**
     * 时
     */
    @Column("cron_hour")
    private Integer cronHour;

    /**
     * 分
     */
    @Column("cron_minute")
    private Integer cronMinute;

    /**
     * 秒
     */
    @Column("cron_second")
    private Integer cronSecond;

    /**
     * 是否开启(0:否,1:是)
     */
    @Column("schedule_enable")
    private Boolean scheduleEnable;

    /**
     * 上次调度时间
     */
    @Column("last_schedule_time")
    private LocalDateTime lastScheduleTime;

    /**
     * 下次调度时间
     */
    @Column("next_schedule_time")
    private LocalDateTime nextScheduleTime;

    /**
     * 正常下次调度时间
     */
    @Column("normal_next_time")
    private LocalDateTime normalNextTime;

    /**
     * 操作人ID
     */
    @Column("operator_id")
    private Long operatorId;

    /**
     * 操作人姓名
     */
    @Column("operator_name")
    private String operatorName;

    /**
     * 创建时间
     */
    @Column("create_time")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @Column("update_time")
    private LocalDateTime updateTime;

    /**
     * 是否删除(0:否,1:是)
     */
    @Column("deleted")
    private Boolean deleted;
}
